class Dep {
    constructor() {
        this.watchers = []
    }
    // 订阅
    add_watcher(watcher) {
        this.watchers.push(watcher)
    }
    // 发布
    notify() {
        this.watchers.map(wathcer=>wathcer.update())
    }

}